﻿using DocumentFormat.OpenXml.Lite.Helper;
using DocumentFormat.OpenXml.Lite.WordprocessingML.Word.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.WordprocessingML.Word.Style
{
    [XmlRoot("latentStyles", Namespace = Constants.WordMain)]
    public class LatentStyles : XmlSerializable
    {
        /// <summary>
        /// Default Style Locking Setting
        /// </summary>
        [Optional]
        [XmlAttribute("defLockedState", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_OnOff> DefaultLockedState { get; set; }

        /// <summary>
        /// Default User Interface Priority Setting
        /// </summary>
        [Optional]
        [XmlAttribute("defUIPriority", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<int> DefaultUiPriority { get; set; }

        /// <summary>
        /// Default Semi-Hidden Setting
        /// </summary>
        [Optional]
        [XmlAttribute("defSemiHidden", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_OnOff> DefaultSemiHidden { get; set; }

        /// <summary>
        /// Default Hidden Until Used Setting
        /// </summary>
        [Optional]
        [XmlAttribute("defUnhideWhenUsed", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_OnOff> DefaultUnhideWhenUsed { get; set; }

        /// <summary>
        /// Default Primary Style Setting
        /// </summary>
        [Optional]
        [XmlAttribute("defQFormat", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_OnOff> DefaultQFormat { get; set; }

        /// <summary>
        /// Latent Style Count
        /// </summary>
        [Optional]
        [XmlAttribute("count", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Count { get; set; }

        [XmlElement("lsdException", Namespace = Constants.WordMain)]
        public XmlList<LatentStyleException> Exceptions { get; set; }

        public LatentStyles()
        {
            Exceptions = new XmlList<LatentStyleException>();
        }
    }
}
